﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace EntityModel.Migrations
{
    public partial class AikeApplet : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Customers",
                columns: table => new
                {
                    cusid = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    clid = table.Column<int>(type: "int", nullable: false),
                    cusname = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cuscompany = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cusman = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cusdesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Customers", x => x.cusid);
                });

            migrationBuilder.CreateTable(
                name: "Depots",
                columns: table => new
                {
                    depotID = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    depotName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    depotMan = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    depotTel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    depotAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    depotdesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Depots", x => x.depotID);
                });

            migrationBuilder.CreateTable(
                name: "DevolveDetail",
                columns: table => new
                {
                    devDID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    devID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    proID = table.Column<int>(type: "int", nullable: false),
                    devDAmount = table.Column<int>(type: "int", nullable: false),
                    devDdesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DevolveDetail", x => x.devDID);
                });

            migrationBuilder.CreateTable(
                name: "Devolves",
                columns: table => new
                {
                    devID = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    devOutID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    devInID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    userID = table.Column<int>(type: "int", nullable: false),
                    devDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    devdesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    devState = table.Column<int>(type: "int", nullable: false),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Devolves", x => x.devID);
                });

            migrationBuilder.CreateTable(
                name: "goods",
                columns: table => new
                {
                    goodsId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    goodsSn = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    goodsName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    goodsImg = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    shopId = table.Column<int>(type: "int", nullable: false),
                    marketPrice = table.Column<decimal>(type: "decimal(18,2)", maxLength: 12, nullable: false),
                    shopPrice = table.Column<decimal>(type: "decimal(18,2)", maxLength: 12, nullable: false),
                    warnStock = table.Column<int>(type: "int", nullable: false),
                    goodsStock = table.Column<int>(type: "int", nullable: false),
                    goodsUnit = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
                    goodsTips = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
                    isSale = table.Column<int>(type: "int", nullable: false),
                    isBest = table.Column<int>(type: "int", nullable: false),
                    isHot = table.Column<int>(type: "int", nullable: false),
                    isNew = table.Column<int>(type: "int", nullable: false),
                    isRecom = table.Column<int>(type: "int", nullable: false),
                    goodsCatId = table.Column<int>(type: "int", nullable: false),
                    goodsCatIdPath = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: true),
                    goodsnetxCatId = table.Column<int>(type: "int", nullable: false),
                    shopCatId1 = table.Column<int>(type: "int", nullable: false),
                    shopCatId2 = table.Column<int>(type: "int", nullable: false),
                    brandId = table.Column<int>(type: "int", nullable: false),
                    goodsDesc = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
                    goodsStatus = table.Column<int>(type: "int", nullable: false),
                    saleNum = table.Column<int>(type: "int", nullable: false),
                    saleTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    visitNum = table.Column<int>(type: "int", nullable: false),
                    appraiseNum = table.Column<int>(type: "int", nullable: false),
                    gallery = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    goodsSeoKeywords = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    dataFlag = table.Column<int>(type: "int", nullable: false),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    goodsType = table.Column<int>(type: "int", nullable: false),
                    isDistribut = table.Column<int>(type: "int", nullable: false),
                    commission = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    isFreeShipping = table.Column<int>(type: "int", nullable: false),
                    goodsSerachKeywords = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
                    costPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    goodsSeoDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    shippingFeeType = table.Column<int>(type: "int", nullable: false),
                    goodsWeight = table.Column<double>(type: "float", nullable: false),
                    goodsVolume = table.Column<double>(type: "float", nullable: false),
                    shopExpressId = table.Column<int>(type: "int", nullable: false),
                    isPifa = table.Column<int>(type: "int", nullable: false),
                    collectNum = table.Column<int>(type: "int", nullable: false),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goods", x => x.goodsId);
                });

            migrationBuilder.CreateTable(
                name: "goods_appraises",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    shopId = table.Column<int>(type: "int", nullable: false),
                    orderId = table.Column<int>(type: "int", nullable: false),
                    goodsId = table.Column<int>(type: "int", nullable: false),
                    goodsSpecId = table.Column<int>(type: "int", nullable: false),
                    userId = table.Column<int>(type: "int", nullable: false),
                    goodsScore = table.Column<int>(type: "int", nullable: false),
                    serviceScore = table.Column<int>(type: "int", nullable: false),
                    timeScore = table.Column<int>(type: "int", nullable: false),
                    content = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
                    shopReply = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
                    images = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    isShow = table.Column<int>(type: "int", nullable: false),
                    dataFlag = table.Column<int>(type: "int", nullable: false),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    replyTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    orderGoodsId = table.Column<int>(type: "int", nullable: false),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goods_appraises", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "goods_attributes",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    shopId = table.Column<int>(type: "int", nullable: false),
                    goodsId = table.Column<int>(type: "int", nullable: false),
                    attrId = table.Column<int>(type: "int", nullable: false),
                    attrVal = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goods_attributes", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "goods_cats",
                columns: table => new
                {
                    catId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    parentId = table.Column<int>(type: "int", nullable: false),
                    catName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    isShow = table.Column<int>(type: "int", nullable: false),
                    dataFlag = table.Column<int>(type: "int", nullable: false),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    commissionRate = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    catImg = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    subTitle = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
                    simpleName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    seoTitle = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    seoKeywords = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    seoDes = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
                    catListTheme = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    detailTheme = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    mobileCatListTheme = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    wechatCatListTheme = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    wechatDetailTheme = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goods_cats", x => x.catId);
                });

            migrationBuilder.CreateTable(
                name: "goods_consult",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    goodsId = table.Column<int>(type: "int", nullable: false),
                    userid = table.Column<int>(type: "int", nullable: false),
                    consultType = table.Column<int>(type: "int", nullable: false),
                    consultContent = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
                    reply = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
                    dataFlag = table.Column<int>(type: "int", nullable: false),
                    isShow = table.Column<int>(type: "int", nullable: false),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goods_consult", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "goods_scores",
                columns: table => new
                {
                    scoreId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    goodsId = table.Column<int>(type: "int", nullable: false),
                    shopId = table.Column<int>(type: "int", nullable: false),
                    totalScore = table.Column<int>(type: "int", nullable: false),
                    totalUsers = table.Column<int>(type: "int", nullable: false),
                    goodsScore = table.Column<int>(type: "int", nullable: false),
                    goodsUsers = table.Column<int>(type: "int", nullable: false),
                    serviceScore = table.Column<int>(type: "int", nullable: false),
                    serviceUsers = table.Column<int>(type: "int", nullable: false),
                    timeScore = table.Column<int>(type: "int", nullable: false),
                    timeUsers = table.Column<int>(type: "int", nullable: false),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goods_scores", x => x.scoreId);
                });

            migrationBuilder.CreateTable(
                name: "goods_specs",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    shopId = table.Column<int>(type: "int", nullable: false),
                    goodsId = table.Column<int>(type: "int", nullable: false),
                    productNo = table.Column<int>(type: "int", nullable: false),
                    marketPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    specPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    specStock = table.Column<int>(type: "int", nullable: false),
                    warnStock = table.Column<int>(type: "int", nullable: false),
                    saleNum = table.Column<int>(type: "int", nullable: false),
                    isDefault = table.Column<int>(type: "int", nullable: false),
                    dataFlag = table.Column<int>(type: "int", nullable: false),
                    specWeight = table.Column<double>(type: "float", nullable: false),
                    specVolume = table.Column<double>(type: "float", nullable: false),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goods_specs", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "goods_virtuals",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    shopId = table.Column<int>(type: "int", nullable: false),
                    goodsId = table.Column<int>(type: "int", nullable: false),
                    cardNo = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    cardPwd = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    orderId = table.Column<int>(type: "int", nullable: false),
                    orderNo = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    isUse = table.Column<int>(type: "int", nullable: false),
                    dataFlag = table.Column<int>(type: "int", nullable: false),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_goods_virtuals", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "LostDetail",
                columns: table => new
                {
                    idID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    lostID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    proID = table.Column<int>(type: "int", nullable: false),
                    ldAmount = table.Column<int>(type: "int", nullable: false),
                    ldPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    lostDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_LostDetail", x => x.idID);
                });

            migrationBuilder.CreateTable(
                name: "Losts",
                columns: table => new
                {
                    lostID = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    depotID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    lostDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    userID = table.Column<int>(type: "int", nullable: false),
                    lostState = table.Column<int>(type: "int", nullable: false),
                    lostDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Losts", x => x.lostID);
                });

            migrationBuilder.CreateTable(
                name: "Members",
                columns: table => new
                {
                    userId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    userName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    realName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    gender = table.Column<int>(type: "int", nullable: false),
                    birthDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    password = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    passwordSalt = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    passwordQuestion = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    passwordAnswer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    gradeId = table.Column<int>(type: "int", nullable: false),
                    email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    mobilephone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    telephone1 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    identityCard = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    tradePassword = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    QQ = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    weChat = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    picture = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    isQuickLogin = table.Column<bool>(type: "bit", nullable: false),
                    isLogined = table.Column<int>(type: "int", nullable: false),
                    address = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    modifiedon = table.Column<DateTime>(type: "datetime2", nullable: false),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Members", x => x.userId);
                });

            migrationBuilder.CreateTable(
                name: "PayOffDetail",
                columns: table => new
                {
                    podID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    poid = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    proID = table.Column<int>(type: "int", nullable: false),
                    podAmount = table.Column<int>(type: "int", nullable: false),
                    podPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    podDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PayOffDetail", x => x.podID);
                });

            migrationBuilder.CreateTable(
                name: "PayOffs",
                columns: table => new
                {
                    poID = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    pepotID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    poDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    userID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    poState = table.Column<int>(type: "int", nullable: false),
                    poDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PayOffs", x => x.poID);
                });

            migrationBuilder.CreateTable(
                name: "ProductLend",
                columns: table => new
                {
                    PPID = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    PPName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    PPCompany = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    PPMan = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
                    PPTel = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    PPAddress = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: true),
                    PPFax = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    PPEmail = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    PPUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    PPBank = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    PPGoods = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    PPDesc = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateOn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ModeTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModeOn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Amount = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProductLend", x => x.PPID);
                });

            migrationBuilder.CreateTable(
                name: "Roles",
                columns: table => new
                {
                    roleID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    rRoleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    roleDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Roles", x => x.roleID);
                });

            migrationBuilder.CreateTable(
                name: "StockDetail",
                columns: table => new
                {
                    sdetailid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    proid = table.Column<int>(type: "int", nullable: false),
                    stockid = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    sdetailAmount = table.Column<int>(type: "int", nullable: false),
                    sdetailPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    sdetailDepAmount = table.Column<int>(type: "int", nullable: false),
                    sdetailDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_StockDetail", x => x.sdetailid);
                });

            migrationBuilder.CreateTable(
                name: "StockInDepot",
                columns: table => new
                {
                    sidid = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    ppid = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    depotid = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    stockid = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    siddate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    siddeliver = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    sidfreight = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    siduser = table.Column<int>(type: "int", nullable: false),
                    siddata = table.Column<int>(type: "int", nullable: false),
                    siddesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_StockInDepot", x => x.sidid);
                });

            migrationBuilder.CreateTable(
                name: "Stocks",
                columns: table => new
                {
                    stockid = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    ppid = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    stockDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    stockInDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    stockUser = table.Column<int>(type: "int", nullable: false),
                    stockState = table.Column<int>(type: "int", nullable: false),
                    stockDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Amount = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Stocks", x => x.stockid);
                });

            migrationBuilder.CreateTable(
                name: "UsersRole",
                columns: table => new
                {
                    urid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    usersID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    roleID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UsersRole", x => x.urid);
                });

            migrationBuilder.CreateTable(
                name: "QuotePrice",
                columns: table => new
                {
                    qpID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    cusID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    customerscusid = table.Column<string>(type: "nvarchar(450)", nullable: true),
                    userID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    membersuserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    createDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    qpState = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    qpDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_QuotePrice", x => x.qpID);
                    table.ForeignKey(
                        name: "FK_QuotePrice_Customers_customerscusid",
                        column: x => x.customerscusid,
                        principalTable: "Customers",
                        principalColumn: "cusid",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_QuotePrice_Members_membersuserId",
                        column: x => x.membersuserId,
                        principalTable: "Members",
                        principalColumn: "userId",
                        onDelete: ReferentialAction.Restrict);
                });

            migrationBuilder.CreateTable(
                name: "QuotePriceDetail",
                columns: table => new
                {
                    qpDID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    qpID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    quotepriceqpID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    proID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    qpDAmount = table.Column<int>(type: "int", nullable: false),
                    qpDPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    qpDDiscont = table.Column<double>(type: "float", nullable: false),
                    qpDDisPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    qpDDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PageIndex = table.Column<int>(type: "int", nullable: false),
                    PageSize = table.Column<int>(type: "int", nullable: false),
                    SortBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SortOrder = table.Column<int>(type: "int", nullable: false),
                    IsCount = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_QuotePriceDetail", x => x.qpDID);
                    table.ForeignKey(
                        name: "FK_QuotePriceDetail_QuotePrice_quotepriceqpID",
                        column: x => x.quotepriceqpID,
                        principalTable: "QuotePrice",
                        principalColumn: "qpID",
                        onDelete: ReferentialAction.Restrict);
                });

            migrationBuilder.CreateIndex(
                name: "IX_QuotePrice_customerscusid",
                table: "QuotePrice",
                column: "customerscusid");

            migrationBuilder.CreateIndex(
                name: "IX_QuotePrice_membersuserId",
                table: "QuotePrice",
                column: "membersuserId");

            migrationBuilder.CreateIndex(
                name: "IX_QuotePriceDetail_quotepriceqpID",
                table: "QuotePriceDetail",
                column: "quotepriceqpID");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Depots");

            migrationBuilder.DropTable(
                name: "DevolveDetail");

            migrationBuilder.DropTable(
                name: "Devolves");

            migrationBuilder.DropTable(
                name: "goods");

            migrationBuilder.DropTable(
                name: "goods_appraises");

            migrationBuilder.DropTable(
                name: "goods_attributes");

            migrationBuilder.DropTable(
                name: "goods_cats");

            migrationBuilder.DropTable(
                name: "goods_consult");

            migrationBuilder.DropTable(
                name: "goods_scores");

            migrationBuilder.DropTable(
                name: "goods_specs");

            migrationBuilder.DropTable(
                name: "goods_virtuals");

            migrationBuilder.DropTable(
                name: "LostDetail");

            migrationBuilder.DropTable(
                name: "Losts");

            migrationBuilder.DropTable(
                name: "PayOffDetail");

            migrationBuilder.DropTable(
                name: "PayOffs");

            migrationBuilder.DropTable(
                name: "ProductLend");

            migrationBuilder.DropTable(
                name: "QuotePriceDetail");

            migrationBuilder.DropTable(
                name: "Roles");

            migrationBuilder.DropTable(
                name: "StockDetail");

            migrationBuilder.DropTable(
                name: "StockInDepot");

            migrationBuilder.DropTable(
                name: "Stocks");

            migrationBuilder.DropTable(
                name: "UsersRole");

            migrationBuilder.DropTable(
                name: "QuotePrice");

            migrationBuilder.DropTable(
                name: "Customers");

            migrationBuilder.DropTable(
                name: "Members");
        }
    }
}
